home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / pvm34b3.zip / pvm34b3 / pvm3 / lib / ipcfree < prev    next >
Text File  |  1997-07-22  |  584b  |  31 lines

  1. #!/bin/sh
  2. #
  3. # $Id: ipcfree,v 1.1 1996/09/23 21:15:42 pvmsrc Exp $
  4. #
  5. # ipcfree
  6. #
  7. # Delete any shared memory or semaphores lying around after a PVM
  8. # program bombs out or is killed ungracefully.
  9. # Run it if you're getting error messages like:
  10. #   semget: ... No space left on device
  11. #   shmget: ... No space left on device
  12. # when using one of the *MP PVM architectures.
  13. #
  14.  
  15. if [ "$USER" = "" ]; then
  16.     USER=` whoami `
  17. fi
  18.  
  19. m=` ipcs | awk '$1~/^[ms]$/ && $5~/'$USER'/ {print "-"$1, $2}' `
  20.  
  21. case "$m" in
  22. ?*) echo "deleting $m"
  23.     ipcrm $m
  24. ;;
  25. *) echo "didn't find anything"
  26. ;;
  27. esac
  28.  
  29. exit 0
  30.  
  31.